#pragma once

#include <gexpl_timer.h>

// 设置定时器的分频，即每多少个时钟周期计时一次。
static inline void timer_set_clock_amount_per_count(timer_qe timer_q,
						    u32_s clock_per_times) {
	timer_set_prescale(timer_q, clock_per_times - 1);
}

// 设置定时器每次循环计数的次数（从0到次数-1，或从次数-1到0）
static inline void timer_set_times_per_cycle(timer_qe timer_q,
					     u32_s times_per_cycle) {
	timer_set_auto_reload_num(timer_q, times_per_cycle - 1);
}
